.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.editor-pane {
  flex: 2; /* Editor takes 2 parts of the space */
  min-width: 400px;
  height: 100%;
  padding: 1rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #d9d9d9;
}

.preview-pane {
  flex: 1; /* Preview takes 1 part of the space */
  overflow-y: auto;
  overflow-x: hidden; /* Explicitly disable horizontal scrolling on the pane */
  background-color: #e9e9e9;
  padding: 2rem;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.editor-toolbar {
  padding-bottom: 1rem;
  border-bottom: 1px solid #d9d9d9;
  margin-bottom: 1rem;
}

.editor-button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.editor-button:hover {
  background-color: #0056b3;
}

.markdown-textarea {
  width: 100%;
  flex-grow: 1;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 1rem;
  box-sizing: border-box;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 14px;
  resize: none;
}

.pages-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.preview-stage {
  width: 360px;
  aspect-ratio: 3 / 4;
  background-color: #ffffff; /* Card background */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06); /* Card shadow */
  border-radius: 12px; /* Card border-radius */
  padding: 2rem;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

/* Fix for oversized images */
.preview-stage img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px; /* 图片圆角 */
}

/* Basic styles for rendered markdown */
.preview-stage h1,
.preview-stage h2,
.preview-stage h3 {
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif; /* From provided CSS */
  font-size: 28px; /* From provided CSS .card-1 h1 */
  font-weight: 700; /* From provided CSS .card-1 h1 */
  color: #003366; /* 深蓝色 */
  margin: 10px 0 15px; /* From provided CSS .card-1 h1 */
  border-bottom: none; /* Remove existing border-bottom */
  padding-bottom: 0; /* Remove existing padding-bottom */
}

.preview-stage p {
  font-size: 16px; /* From provided CSS .card-1 blockquote/ul */
  line-height: 1.7; /* From provided CSS .card-1 blockquote */
  color: #5E6A7A; /* From provided CSS .card-1 blockquote/ul */
}

.preview-stage blockquote {
  margin: 0 0 20px 0; /* From provided CSS .card-1 blockquote */
  padding-left: 18px; /* From provided CSS .card-1 blockquote */
  border-left: 4px solid #3D4A5C; /* From provided CSS .card-1 blockquote */
  font-size: 16px; /* From provided CSS .card-1 blockquote */
  line-height: 1.7; /* From provided CSS .card-1 blockquote */
  color: #5E6A7A; /* From provided CSS .card-1 blockquote */
}

.preview-stage ul {
  list-style-type: none; /* From provided CSS .card-1 ul */
  padding-left: 0; /* From provided CSS .card-1 ul */
  font-size: 16px; /* From provided CSS .card-1 ul */
  line-height: 1.8; /* From provided CSS .card-1 ul */
  margin: 0; /* From provided CSS .card-1 ul */
  color: #5E6A7A; /* From provided CSS .card-1 ul */
}

.preview-stage li {
  padding-left: 20px; /* From provided CSS .card-1 li */
  position: relative; /* From provided CSS .card-1 li */
}

.preview-stage li::before {
  content: '•'; /* From provided CSS .card-1 li::before */
  position: absolute; /* From provided CSS .card-1 li::before */
  left: 0; /* From provided CSS .card-1 li::before */
  top: 0; /* From provided CSS .card-1 li::before */
  color: #3D4A5C; /* From provided CSS .card-1 li::before */
  font-size: 18px; /* From provided CSS .card-1 li::before */
}

.preview-stage li:not(:last-child) {
  margin-bottom: 12px; /* From provided CSS .card-1 li:not(:last-child) */
}

.preview-stage .highlight {
    font-weight: 700;
    color: #FF9900; /* 橙黄色 */
    font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
}

.preview-stage pre {
  background-color: #f5f5f5;
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto; /* This is necessary for long code lines */
}

.preview-stage code {
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  color: #d63384;
}

